* This script contains the code to select the best model according to BIC for the analysis in Table A7 of the on-line appendix in Ductor, L., Fafchamps, M., Goyal S. and M. van der Leij. Social Networks and Research Output. The Review of Economics and Statistics.

log using modelselection_fs_dt.log, replace
use prodndnp_fullsample_dt.dta

/*Selecting the best models according to BIC:*/
/*OLS out-of-sample program*/
cap pro drop ols_os
program define ols_os
syntax varlist(numeric min=1) [if]
marksample touse
quietly reg `varlist' if `touse', vce(cluster auth)
qui scalar n1=e(N)
estat ic
scalar rmseols=e(rmse)
predict ybols if group==2 & lprodf3dt<., xb 
scalar r2i1ols= e(r2)   /*computing the R2 of the baseline model*/
qui gen sqerrols= (lprodf3dt-ybols)^2 if ybols<.
quietly egen peols=sum(sqerrols)if ybols<.  /*RSEE of the predicted model*/
quietly sum peols    /*summarizing the RSEE*/
quietly scalar rssols=r(max)  /*obtaining the total RSEE*/
quietly scalar nols=r(N)    /*number of observations in group 2*/
scalar rmseo2ols=(rssols/(nols-(e(df_m)+2)))^0.5   /*RMSE out of sample*/
di rmseols   "  Pooled OLS in-sample RMSE"
di n1 " Number of observations in the in-sample group"
di rmseo2ols "  Pooled OLS out-of-sample RMSE"
di nols " Number of observations in the out-of-sample group"
drop sqerrols peols ybols
end


order auth year t2-t27 lcprod5 lcprodl5 lprodf3dtdt lprodf3ldt*

ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l24dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l23dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l22dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l21dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l20dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l19dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l18dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l17dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l16dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l15dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l13dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l12dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l11dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l10dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l9dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l8dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l7dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l6dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l5dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l4dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l3dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l2dt if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt if group==1



/*The best model in terms of BIC and RMSE out-of-sample contains 14 lags*/

/************************MODELS 3: INCLUDE OUTPUT AND A NETWORK VARIABLE***********************/
/*Coauthors' productivity model*/

ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y lnetproddt13y lnetproddt14y lnetproddt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y lnetproddt13y lnetproddt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y lnetproddt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y lnetproddt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y lnetproddt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y if group==1

/*Best model: lag 12*/

/*Couathors' coauthors productivity*/

ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y lnetprod2dt13y lnetprod2dt14y lnetprod2dt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y lnetprod2dt13y lnetprod2dt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y lnetprod2dt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y lnetprod2dt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetprod2dt1y if group==1
/* Best model: 12 lags*/

/*Degree*/

ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y degree15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y degree7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y degree6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y degree5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y degree4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y degree3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y degree2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree1y if group==1

/* Best model: 4 lags*/

/*Degree of order 2*/


ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y degree215y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y degree27y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y degree26y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y degree25y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y degree24y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y degree23y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y degree22y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt degree21y if group==1

/*Best model: lags 5*/

/*Giant Component*/
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc14y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc13y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc12y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc11y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc10y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc9y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc8y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc7y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc6y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc5y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc4y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc3y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y  if group==1
/*lags 8*/

/*Betweenness*/
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc15y lbet1y-lbet15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc14y lbet1y-lbet14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc13y  lbet1y-lbet13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc12y  lbet1y-lbet12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc11y lbet1y-lbet11y   if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc10y lbet1y-lbet10y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc9y lbet1y-lbet9y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc8y lbet1y-lbet8y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc7y lbet1y-lbet7y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc6y lbet1y-lbet6y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc5y lbet1y-lbet5y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc4y lbet1y-lbet4y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc3y lbet1y-lbet3y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y lbet1y lbet2y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y lbet1y if group==1
/* lags 9*/

/*closenness*/
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc15y lclos1y-lclos15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc14y lclos1y-lclos14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc13y  lclos1y-lclos13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc12y  lclos1y-lclos12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc11y lclos1y-lclos11y   if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc10y lclos1y-lclos10y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc9y lclos1y-lclos9y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc8y lclos1y-lclos8y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc7y lclos1y-lclos7y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc6y lclos1y-lclos6y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc5y lclos1y-lclos5y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc4y lclos1y-lclos4y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y-gc3y lclos1y-lclos3y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y gc2y lclos1y lclos2y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt gc1y lclos1y if group==1
/*lags 8*/

/*Working with a top 1%*/

ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y neiq1fsdt13y neiq1fsdt14y neiq1fsdt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y neiq1fsdt13y neiq1fsdt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y neiq1fsdt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y neiq1fsdt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt neiq1fsdt1y if group==1

/************************MODELS 2: BASELINE MODEL + A NETWORK VARIABLE***********************/
/*Coauthors' productivity*/

ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y lnetproddt13y lnetproddt14y lnetproddt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y lnetproddt13y lnetproddt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y lnetproddt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y lnetproddt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y lnetproddt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y lnetproddt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y lnetproddt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y lnetproddt8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y lnetproddt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y lnetproddt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y lnetproddt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y lnetproddt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y lnetproddt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y lnetproddt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetproddt1y if group==1
/*15y lowest BIC*/

/*Coauthors' coauthors productivity*/

ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y lnetprod2dt13y lnetprod2dt14y lnetprod2dt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y lnetprod2dt13y lnetprod2dt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y lnetprod2dt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y lnetprod2dt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y lnetprod2dt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y lnetprod2dt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y lnetprod2dt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y lnetprod2dt8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y lnetprod2dt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y lnetprod2dt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y lnetprod2dt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y lnetprod2dt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y lnetprod2dt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y lnetprod2dt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  lnetprod2dt1y if group==1
/* 15y lowest BIC*/

/*Degree*/

ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y degree15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y degree14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y degree13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y degree12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y degree11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y degree10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y degree9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y degree8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y degree7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y degree6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y degree5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y degree4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y degree3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y degree2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree1y if group==1
/* 15y lowest BIC*/


/*Degree of order 2*/


ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y degree215y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y degree214y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y degree213y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y degree212y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y degree211y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y degree210y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y degree29y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y degree28y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y degree27y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y degree26y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y degree25y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y degree24y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y degree23y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y degree22y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  degree21y if group==1
/* 15y lowest BIC*/


/*Giant Component*/
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc14y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc13y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc12y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc11y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc10y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc9y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc8y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc7y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc6y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc5y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc4y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc3y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y  if group==1
/* 15y lowest BIC*/

/*Betweenness*/
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc15y lbet1y-lbet15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc14y lbet1y-lbet14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc13y  lbet1y-lbet13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc12y  lbet1y-lbet12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc11y lbet1y-lbet11y   if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc10y lbet1y-lbet10y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc9y lbet1y-lbet9y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc8y lbet1y-lbet8y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc7y lbet1y-lbet7y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc6y lbet1y-lbet6y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc5y lbet1y-lbet5y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc4y lbet1y-lbet4y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc3y lbet1y-lbet3y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y lbet1y lbet2y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y lbet1y if group==1
/* 15y lowest BIC*/

/*closenness*/
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc15y lclos1y-lclos15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc14y lclos1y-lclos14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc13y  lclos1y-lclos13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc12y  lclos1y-lclos12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc11y lclos1y-lclos11y   if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc10y lclos1y-lclos10y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc9y lclos1y-lclos9y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc8y lclos1y-lclos8y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc7y lclos1y-lclos7y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc6y lclos1y-lclos6y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc5y lclos1y-lclos5y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc4y lclos1y-lclos4y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y-gc3y lclos1y-lclos3y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y gc2y lclos1y lclos2y  if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  gc1y lclos1y if group==1
/* 15y lowest BIC*/

/*Working with a top 1%*/

ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y neiq1fsdt13y neiq1fsdt14y neiq1fsdt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y neiq1fsdt13y neiq1fsdt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y neiq1fsdt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y neiq1fsdt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y neiq1fsdt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y neiq1fsdt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y neiq1fsdt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y neiq1fsdt8y if group==1 
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y neiq1fsdt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y neiq1fsdt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y neiq1fsdt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y neiq1fsdt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y neiq1fsdt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y neiq1fsdt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27  neiq1fsdt1y if group==1
/* 14y lowest BIC*/

/************************Multivariate Model 2: INCLUDE All THE RELEVANT NETWORK VARIABLES***********************/

/*Stepwise*/

ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt15y lnetprod2dt1y-lnetprod2dt15y degree1y-degree15y degree21y-degree215y gc1y-gc15y lbet1y-lbet15y lclos1y-lclos15y neiq1fsdt1y-neiq1fsdt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt14y lnetprod2dt1y-lnetprod2dt14y degree1y-degree14y degree21y-degree214y gc1y-gc14y lbet1y-lbet14y lclos1y-lclos14y neiq1fsdt1y-neiq1fsdt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt13y lnetprod2dt1y-lnetprod2dt13y degree1y-degree13y degree21y-degree213y gc1y-gc13y lbet1y-lbet13y lclos1y-lclos13y neiq1fsdt1y-neiq1fsdt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt12y lnetprod2dt1y-lnetprod2dt12y degree1y-degree12y degree21y-degree212y gc1y-gc12y lbet1y-lbet12y lclos1y-lclos12y neiq1fsdt1y-neiq1fsdt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt11y lnetprod2dt1y-lnetprod2dt11y degree1y-degree11y degree21y-degree211y gc1y-gc11y lbet1y-lbet11y lclos1y-lclos11y neiq1fsdt1y-neiq1fsdt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt10y lnetprod2dt1y-lnetprod2dt10y degree1y-degree10y degree21y-degree210y gc1y-gc10y lbet1y-lbet10y lclos1y-lclos10y neiq1fsdt1y-neiq1fsdt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt9y lnetprod2dt1y-lnetprod2dt9y degree1y-degree9y degree21y-degree29y gc1y-gc9y lbet1y-lbet9y lclos1y-lclos9y neiq1fsdt1y-neiq1fsdt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt8y lnetprod2dt1y-lnetprod2dt8y degree1y-degree8y degree21y-degree28y gc1y-gc8y lbet1y-lbet8y lclos1y-lclos8y neiq1fsdt1y-neiq1fsdt8y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt7y lnetprod2dt1y-lnetprod2dt7y degree1y-degree7y degree21y-degree27y gc1y-gc7y lbet1y-lbet7y lclos1y-lclos7y neiq1fsdt1y-neiq1fsdt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt6y lnetprod2dt1y-lnetprod2dt6y degree1y-degree6y degree21y-degree26y gc1y-gc6y lbet1y-lbet6y lclos1y-lclos6y neiq1fsdt1y-neiq1fsdt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lnetproddt1y-lnetproddt5y lnetprod2dt1y-lnetprod2dt5y degree1y-degree5y degree21y-degree25y gc1y-gc5y lbet1y-lbet5y lclos1y-lclos5y neiq1fsdt1y-neiq1fsdt5y if group==1




/************************Multivariate Model 3: Past output+All THE RELEVANT NETWORK VARIABLES***********************/

/*Stepwise*/

ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt15y lnetprod2dt1y-lnetprod2dt15y degree1y-degree15y degree21y-degree215y gc1y-gc15y lbet1y-lbet15y lclos1y-lclos15y neiq1fsdt1y-neiq1fsdt15y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt14y lnetprod2dt1y-lnetprod2dt14y degree1y-degree14y degree21y-degree214y gc1y-gc14y lbet1y-lbet14y lclos1y-lclos14y neiq1fsdt1y-neiq1fsdt14y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt13y lnetprod2dt1y-lnetprod2dt13y degree1y-degree13y degree21y-degree213y gc1y-gc13y lbet1y-lbet13y lclos1y-lclos13y neiq1fsdt1y-neiq1fsdt13y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt12y lnetprod2dt1y-lnetprod2dt12y degree1y-degree12y degree21y-degree212y gc1y-gc12y lbet1y-lbet12y lclos1y-lclos12y neiq1fsdt1y-neiq1fsdt12y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt11y lnetprod2dt1y-lnetprod2dt11y degree1y-degree11y degree21y-degree211y gc1y-gc11y lbet1y-lbet11y lclos1y-lclos11y neiq1fsdt1y-neiq1fsdt11y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt10y lnetprod2dt1y-lnetprod2dt10y degree1y-degree10y degree21y-degree210y gc1y-gc10y lbet1y-lbet10y lclos1y-lclos10y neiq1fsdt1y-neiq1fsdt10y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt9y lnetprod2dt1y-lnetprod2dt9y degree1y-degree9y degree21y-degree29y gc1y-gc9y lbet1y-lbet9y lclos1y-lclos9y neiq1fsdt1y-neiq1fsdt9y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt8y lnetprod2dt1y-lnetprod2dt8y degree1y-degree8y degree21y-degree28y gc1y-gc8y lbet1y-lbet8y lclos1y-lclos8y neiq1fsdt1y-neiq1fsdt8y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt7y lnetprod2dt1y-lnetprod2dt7y degree1y-degree7y degree21y-degree27y gc1y-gc7y lbet1y-lbet7y lclos1y-lclos7y neiq1fsdt1y-neiq1fsdt7y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt6y lnetprod2dt1y-lnetprod2dt6y degree1y-degree6y degree21y-degree26y gc1y-gc6y lbet1y-lbet6y lclos1y-lclos6y neiq1fsdt1y-neiq1fsdt6y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt5y lnetprod2dt1y-lnetprod2dt5y degree1y-degree5y degree21y-degree25y gc1y-gc5y lbet1y-lbet5y lclos1y-lclos5y neiq1fsdt1y-neiq1fsdt5y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt4y lnetprod2dt1y-lnetprod2dt4y degree1y-degree4y degree21y-degree24y gc1y-gc4y lbet1y-lbet4y lclos1y-lclos4y neiq1fsdt1y-neiq1fsdt4y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt3y lnetprod2dt1y-lnetprod2dt3y degree1y-degree3y degree21y-degree23y gc1y-gc3y lbet1y-lbet3y lclos1y-lclos3y neiq1fsdt1y-neiq1fsdt3y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt2y lnetprod2dt1y-lnetprod2dt2y degree1y-degree2y degree21y-degree22y gc1y-gc2y lbet1y-lbet2y lclos1y-lclos2y neiq1fsdt1y-neiq1fsdt2y if group==1
ols_os lprodf3dt y2-y27 nopapers t2-t27 lprodf3ldt-lprodf3l14dt lnetproddt1y-lnetproddt1y lnetprod2dt1y-lnetprod2dt1y degree1y-degree1y degree21y-degree21y gc1y-gc1y lbet1y-lbet1y lclos1y-lclos1y neiq1fsdt1y-neiq1fsdt1y if group==1

/*8 lag, lowest BIC*/

log close
